#include <iostream>
using namespace std;
//#include <memory>
/*
	1 单例模式
	2 简单工厂 - 工厂方法 - 抽象工厂
	3 策略模式
	4 观察者模式
	5 代理模式
	
	........................
	6 模板方法模式
	7 适配器模式
	.8 装饰模式



*/

class Student{
public:
	virtual void exam() const  = 0;
};
class Cheater : public Student{
		public:
				void exam() const { cout << "作弊者参加考试" << endl; } 
};
class Proxy : public Student{
		private:
				Student* cheater;
		public:
				Proxy(Student* stu)
						:cheater(stu)
				{	

				}

				void exam() const
				{
						cheater->exam();
				}
};
#if 1
class auto_ptr{
		private:
				Cheater* p;
		public:
				auto_ptr(Cheater* p)
						:p(p)
				{

				}
				~auto_ptr()
				{
						delete p;
				}

				/* -> * = 拷贝构造*/
};

#endif

int main(void)
{
		Cheater* cheater = new Cheater();
		Proxy proxy(cheater);

		proxy.exam();

		//auto_ptr<Cheater> p(cheater);
		auto_ptr p(cheater);
		return 0;
}
